class ProductProductionorderdetail {

  String? id;
  String? planid;
  String? parentid;
  String? productspec;
  String? productname;
  String? productstyle;
  String? workshop;
  String? workshopname;
  String? plate;
  String? plantype;
  String? unitqty;
  String? totalunitqty;
  String? planqty;
  String? unitname;
  String? productused;
  String? pkgflag;
  String? innerflag;
  String? innerworkshop;
  String? techrequired;
  String? envrequired;
  String? iskey;
  String? remark;
  String? seqno;
  String? createUid;
  String? createDate;
  String? writeUid;
  String? writeDate;
  String? orderId;

  ProductProductionorderdetail({
    this.id,
    this.planid,
    this.parentid,
    this.productspec,
    this.productname,
    this.productstyle,
    this.workshop,
    this.workshopname,
    this.plate,
    this.plantype,
    this.unitqty,
    this.totalunitqty,
    this.planqty,
    this.unitname,
    this.productused,
    this.pkgflag,
    this.innerflag,
    this.innerworkshop,
    this.techrequired,
    this.envrequired,
    this.iskey,
    this.remark,
    this.seqno,
    this.createUid,
    this.createDate,
    this.writeUid,
    this.writeDate,
    this.orderId,
  });

  ProductProductionorderdetail copyWith({
    String? id,
    String? planid,
    String? parentid,
    String? productspec,
    String? productname,
    String? productstyle,
    String? workshop,
    String? workshopname,
    String? plate,
    String? plantype,
    String? unitqty,
    String? totalunitqty,
    String? planqty,
    String? unitname,
    String? productused,
    String? pkgflag,
    String? innerflag,
    String? innerworkshop,
    String? techrequired,
    String? envrequired,
    String? iskey,
    String? remark,
    String? seqno,
    String? createUid,
    String? createDate,
    String? writeUid,
    String? writeDate,
  }) {
    return new ProductProductionorderdetail(
      id: id ?? this.id,
      planid: planid ?? this.planid,
      parentid: parentid ?? this.parentid,
      productspec: productspec ?? this.productspec,
      productname: productname ?? this.productname,
      productstyle: productstyle ?? this.productstyle,
      workshop: workshop ?? this.workshop,
      workshopname: workshopname ?? this.workshopname,
      plate: plate ?? this.plate,
      plantype: plantype ?? this.plantype,
      unitqty: unitqty ?? this.unitqty,
      totalunitqty: totalunitqty ?? this.totalunitqty,
      planqty: planqty ?? this.planqty,
      unitname: unitname ?? this.unitname,
      productused: productused ?? this.productused,
      pkgflag: pkgflag ?? this.pkgflag,
      innerflag: innerflag ?? this.innerflag,
      innerworkshop: innerworkshop ?? this.innerworkshop,
      techrequired: techrequired ?? this.techrequired,
      envrequired: envrequired ?? this.envrequired,
      iskey: iskey ?? this.iskey,
      remark: remark ?? this.remark,
      seqno: seqno ?? this.seqno,
      createUid: createUid ?? this.createUid,
      createDate: createDate ?? this.createDate,
      writeUid: writeUid ?? this.writeUid,
      writeDate: writeDate ?? this.writeDate,
    );
  }

  @override
  String toString() {
    return '''ProductProductionorderdetail{
      id: id,
      planid: planid,
      parentid: parentid,
      productspec: productspec,
      productname: productname,
      productstyle: productstyle,
      workshop: workshop,
      workshopname: workshopname,
      plate: plate,
      plantype: plantype,
      unitqty: unitqty,
      totalunitqty: totalunitqty,
      planqty: planqty,
      unitname: unitname,
      productused: productused,
      pkgflag: pkgflag,
      innerflag: innerflag,
      innerworkshop: innerworkshop,
      techrequired: techrequired,
      envrequired: envrequired,
      iskey: iskey,
      remark: remark,
      seqno: seqno,
      createUid: createUid,
      createDate: createDate,
      writeUid: writeUid,
      writeDate: writeDate,
    }''';
  }

  @override
  bool operator ==(Object other) => identical(this, other) || (
      other is ProductProductionorderdetail &&
          runtimeType == other.runtimeType
          && id== other.id
          && planid== other.planid
          && parentid== other.parentid
          && productspec== other.productspec
          && productname== other.productname
          && productstyle== other.productstyle
          && workshop== other.workshop
          && workshopname== other.workshopname
          && plate== other.plate
          && plantype== other.plantype
          && unitqty== other.unitqty
          && totalunitqty== other.totalunitqty
          && planqty== other.planqty
          && unitname== other.unitname
          && productused== other.productused
          && pkgflag== other.pkgflag
          && innerflag== other.innerflag
          && innerworkshop== other.innerworkshop
          && techrequired== other.techrequired
          && envrequired== other.envrequired
          && iskey== other.iskey
          && remark== other.remark
          && seqno== other.seqno
          && createUid== other.createUid
          && createDate== other.createDate
          && writeUid== other.writeUid
          && writeDate== other.writeDate
   );


  factory ProductProductionorderdetail.fromMap(Map<String, dynamic> map) {
    return new ProductProductionorderdetail(
      id: map['id']!=false?map['id'].toString() as String?:"",
      planid: map['planid']!=false?map['planid'].toString() as String?:"",
      parentid: map['parentid']!=false?map['parentid'].toString() as String?:"",
      productspec: map['productspec']!=false?map['productspec'].toString() as String?:"",
      productname: map['productname']!=false?map['productname'].toString() as String?:"",
      productstyle: map['productstyle']!=false?map['productstyle'].toString() as String?:"",
      workshop: map['workshop']!=false?map['workshop'].toString() as String?:"",
      workshopname: map['workshopname']!=false?map['workshopname'].toString() as String?:"",
      plate: map['plate']!=false?map['plate'].toString() as String?:"",
      plantype: map['plantype']!=false?map['plantype'].toString() as String?:"",
      unitqty: map['unitqty']!=false?map['unitqty'].toString() as String?:"",
      totalunitqty: map['totalunitqty']!=false?map['totalunitqty'].toString() as String?:"",
      planqty: map['planqty']!=false?map['planqty'].toString() as String?:"",
      unitname: map['unitname']!=false?map['unitname'].toString() as String?:"",
      productused: map['productused']!=false?map['productused'].toString() as String?:"",
      pkgflag: map['pkgflag']!=false?map['pkgflag'].toString() as String?:"",
      innerflag: map['innerflag']!=false?map['innerflag'].toString() as String?:"",
      innerworkshop: map['innerworkshop']!=false?map['innerworkshop'].toString() as String?:"",
      techrequired: map['techrequired']!=false?map['techrequired'].toString() as String?:"",
      envrequired: map['envrequired']!=false?map['envrequired'].toString() as String?:"",
      iskey: map['iskey']!=false?map['iskey'].toString() as String?:"",
      remark: map['remark']!=false?map['remark'].toString() as String?:"",
      seqno: map['seqno']!=false?map['seqno'].toString() as String?:"",
      createUid: map['create_uid']!=false?map['create_uid'].toString() as String?:"",
      createDate: map['create_date']!=false?map['create_date'].toString() as String?:"",
      writeUid: map['write_uid']!=false?map['write_uid'].toString() as String?:"",
      writeDate: map['write_date']!=false?map['write_date'].toString() as String?:"",
    );
  }

  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'planid': this.planid,
      'parentid': this.parentid,
      'productspec': this.productspec,
      'productname': this.productname,
      'productstyle': this.productstyle,
      'workshop': this.workshop,
      'workshopname': this.workshopname,
      'plate': this.plate,
      'plantype': this.plantype,
      'unitqty': this.unitqty,
      'totalunitqty': this.totalunitqty,
      'planqty': this.planqty,
      'unitname': this.unitname,
      'productused': this.productused,
      'pkgflag': this.pkgflag,
      'innerflag': this.innerflag,
      'innerworkshop': this.innerworkshop,
      'techrequired': this.techrequired,
      'envrequired': this.envrequired,
      'iskey': this.iskey,
      'remark': this.remark,
      'seqno': this.seqno,
      'createUid': this.createUid,
      'createDate': this.createDate,
      'writeUid': this.writeUid,
      'writeDate': this.writeDate,
    } as Map<String, dynamic>;
  }

  List toDomainList() {
    List list = [
      if(this.orderId!=null && this.orderId!='')['order_id','=',int.parse(this.orderId!)],
    ];
    // ignore: unnecessary_cast
    return list;
  }

  Map<String, dynamic> toOdooMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'planid': this.planid,
      'parentid': this.parentid,
      'productspec': this.productspec,
      'productname': this.productname,
      'productstyle': this.productstyle,
      'workshop': this.workshop,
      'workshopname': this.workshopname,
      'plate': this.plate,
      'plantype': this.plantype,
      'unitqty': this.unitqty,
      'totalunitqty': this.totalunitqty,
      'planqty': this.planqty,
      'unitname': this.unitname,
      'productused': this.productused,
      'pkgflag': this.pkgflag,
      'innerflag': this.innerflag,
      'innerworkshop': this.innerworkshop,
      'techrequired': this.techrequired,
      'envrequired': this.envrequired,
      'iskey': this.iskey,
      'remark': this.remark,
      'seqno': this.seqno,
      'create_uid': this.createUid,
      'create_date': this.createDate,
      'write_uid': this.writeUid,
      'write_date': this.writeDate,
    } as Map<String, dynamic>;
  }

//</editor-fold>

}